package hashing;

public class BKDRHash {
    //Do livro "The C Programming Language" de Brian Kernighan e Dennis Ritchie
    public long Hash(char str[], int len){
        int seed = 131;
        long hash = 0;
        int i    = 0;
        for(i = 0; i < len; i++){
            hash = (hash * seed) + (str[i]);
        }
        return hash;
    }
}